﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace RobotGerchik.DataClass.BaseTransaqCalss
{
    /// <summary>
    /// Сделки по инструменту(ам)
    /// </summary>
    public class AllTrades
    {
        #region Private

        private int _secid;
        private string _seccode;
        private long _tradeno;
        private DateTime _time;
        private string _board;
        private double _price;
        private int _quantity;
        private string _buysell;
        private int _openIterest;
        private string _period;

        #endregion

        #region Public
        /// <summary>
        /// внутренний код
        /// </summary>
        public int Secid
        {
            get { return _secid; }
            set
            {
                if (_secid != value)
                {
                    _secid = value;
                    RaisePropertyChanged("Secid");
                }
            }
        }

        /// <summary>
        /// Код инструмента
        /// </summary>
        public string Seccode
        {
            get { return _seccode; }
            set
            {
                if (_seccode != value)
                {
                    _seccode = value;
                    RaisePropertyChanged("Seccode");
                }
            }
        }
        
        /// <summary>
        /// Код инструмента
        /// </summary>
        public long Tradeno
        {
            get { return _tradeno; }
            set
            {
                if (_tradeno != value)
                {
                    _tradeno = value;
                    RaisePropertyChanged("Tradeno");
                }
            }
        }

        /// <summary>
        /// Дата и время
        /// </summary>
        public DateTime TimeDeal
        {
            get { return _time; }
            set
            {
                if (_time != value)
                {
                    _time = value;
                    RaisePropertyChanged("TimeDeal");
                }
            }
        }

        /// <summary>
        /// наименование борда
        /// </summary>
        public string Board
        {
            get { return _board; }
            set
            {
                if (_board != value)
                {
                    _board = value;
                    RaisePropertyChanged("Board");
                }
            }
        }

        /// <summary>
        /// цена сделки
        /// </summary>
        public double Price
        {
            get { return _price; }
            set
            {
                if (_price != value)
                {
                    _price = value;
                    RaisePropertyChanged("Price");
                }
            }
        }

        /// <summary>
        /// объем сделки
        /// </summary>
        public int Quantity
        {
            get { return _quantity; }
            set
            {
                if (_quantity != value)
                {
                    _quantity = value;
                    RaisePropertyChanged("Quantity");
                }
            }
        }

        /// <summary>
        ///покупка (B) / продажа (S)
        /// </summary>
        public string Buysell
        {
            get { return _buysell; }
            set
            {
                if (_buysell != value)
                {
                    _buysell = value;
                    RaisePropertyChanged("Buysell");
                }
            }
        }

        /// <summary>
        /// ...
        /// </summary>
        public int OpenIterest
        {
            get { return _openIterest; }
            set
            {
                if (_openIterest != value)
                {
                    _openIterest = value;
                    RaisePropertyChanged("OpenIterest");
                }
            }
        }

        /// <summary>
        ///Период торгов (O - открытие, N - торги, С -закрытие)
        /// </summary>
        public string Period
        {
            get { return _period; }
            set
            {
                if (_period != value)
                {
                    _period = value;
                    RaisePropertyChanged("Period");
                }
            }
        }

       

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
